package actions;

import gui.Frame;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

/**
 * An action for browsing jobs available for a volunteer.
 * User story 7.
 * @author Christian
 *
 */
@SuppressWarnings("serial")
public class BrowseJobsAction extends AbstractAction {

	private final Frame myFrame;
	
	public BrowseJobsAction(final Frame theFrame) {
		super("Browse Jobs");
		myFrame = theFrame;
	}
	
	/**
	 * Sets the previous action for the last screen displayed.
	 */
	@Override
	public void actionPerformed(ActionEvent e) {
		myFrame.setPreviousAction(new HomeAction(myFrame));
		myFrame.browseJobs(null);
	}

}
